package com.shopping.pojo;

import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

public class Order {

    int id;
    int userId;
    @NotNull
    int tradeId;
    int appraiseId;
    @Min(1)
    int number;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    Date time;
    @NotNull
    int receiveId;
    @Size(max = 20, min = 4)
    String transportNum;
    @NotNull
    int storeId;

    public void setId(int id) {
        this.id = id;
    }

    public int getStoreId() {
        return storeId;
    }

    public void setStoreId(int storeId) {
        this.storeId = storeId;
    }

    public int getId() {
        return id;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public int getTradeId() {
        return tradeId;
    }

    public void setTradeId(int tradeId) {
        this.tradeId = tradeId;
    }

    public int getAppraiseId() {
        return appraiseId;
    }

    public void setAppraiseId(int appraiseId) {
        this.appraiseId = appraiseId;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public int getReceiveId() {
        return receiveId;
    }

    public void setReceiveId(int receiveId) {
        this.receiveId = receiveId;
    }

    public String getTransportNum() {
        return transportNum;
    }

    public void setTransportNum(String transportNum) {
        this.transportNum = transportNum;
    }

    @Override
    public String toString() {
        return "Order{" +
                "id=" + id +
                ", userId=" + userId +
                ", tradeId=" + tradeId +
                ", appraiseId=" + appraiseId +
                ", number=" + number +
                ", time=" + time +
                ", receiveId=" + receiveId +
                ", transportNum='" + transportNum + '\'' +
                '}';
    }
}
